package com.结构型模式.组合模式.原理;

/**
 * @author chenhs
 * @date 2020/11/8
 */
public class Test {
	public static void main(String[] args) {
		IComponent a = new Leaf1("第一叶");
		IComponent b = new Leaf3("第二叶");
		IComponent c = new Bole1("主干");
		c.add(a);
		c.add(b);
		c.operation();
		IComponent son = c.getSon(1);
		son.operation();
	}
}
